package com.csk.zsk.compents.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.csk.zsk.compents.dao.NewsDao;
import com.csk.zsk.compents.entity.News;
import com.csk.zsk.compents.service.NewsService;

@Service
@Transactional
public class NewsServiceImpl implements NewsService {
	@Autowired
	private NewsDao newsDao;
	
	@Override
	public News getNews(String id) {
		return newsDao.getIdByGetMethod(id);
	}

	@Override
	public News getTop1() {
		
		return newsDao.getTop1();
	}

	@Override
	public List<News> getNewsByTypeByTime(String type, int length) {
		return newsDao.getNewsByTypeByTime(type, length);
	}

	@Override
	public List<News> getNewsByTime(int length) {
		return newsDao.getNewsByTime(length);
	}

}
